function image = read_image(fname)

f = fopen(fname, 'r');

if f < 0,
    x = [];
    return;
end;

s=fread(f, 2, '*uint32');

x = fread(f, double(s(1)*s(2)), '*double');

 image = zeros(s(2) , s(1));
 
 k = 1;
 
 for i = 1:s(2)
     for j = 1:s(1)
         image(i , j) = x(k);
        
             k= k+1;
 
     end
 end


imshow(image);

fclose all;
